<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Login</title>
        <ui:include src="Header.xhtml"/>
        <p:messages id="messages" autoUpdate="true"/>
    </h:head>
    <h:body>
        <p:panel header="Inserisci le tue credenziali per effettuare l'accesso o registrati" style="margin-bottom:10px;">

            <h:form>

                <h:panelGrid columns="2" id="grid">
                    <p:outputLabel for="user" value="Username:" />
                    <p:inputText id="user" required="true" requiredMessage= "Inserire username" value="#{login.username}"/> 
                    <p:outputLabel for="password" value="Password:" />
                    <p:password id="password" required="true" requiredMessage= "Inserire password" value="#{login.password}" />
                </h:panelGrid>
                <p:commandButton update="grid" value="Accedi" action="#{login.accesso(gestioneCliente, gestioneSito)}" ></p:commandButton>

            </h:form> 

            <h3>
                <p:outputLabel value="Non sei ancora un utente registrato?"/>
            </h3>
            <h:form >

                <p:button style="color: #831608" value="Registrati" outcome="Registrazione"/>
            </h:form>
        </p:panel>
        <ui:include src="Footer.xhtml"/>  
    </h:body>
</html>

